﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="YongHuXXJX.aspx.cs" Inherits="Web.Pages.YongShui._12.ChaXunGL.YongHuXXJX" Theme="Default" %>

<%@ Register Assembly="DevExpress.Web.v15.2, Version=15.2.9.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web" TagPrefix="dx" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <script src="../../../JS/jquery.js" type="text/javascript"></script>
    <script src="../../../JS/AddEditCancel.js" type="text/javascript"></script>
    <link href="../../../css/inputBgColor.css" rel="stylesheet" />
    <style type="text/css">
        body, html {
            padding: 0;
            margin: 0;
            font-size:12px;
        }

        #img table tr td div {
            cursor: pointer;
        }


    </style>
    <script type="text/javascript">
        $(function () {
            var height = Math.max(0, document.documentElement.clientHeight)-90;
            $("#condition").css("height", height);
        });

        function GVScrollToVisibleIndexOnClient(obj, index) {
            obj.SetVerticalScrollPosition(index * 25);
        }

        function first(obj) {
            obj.SetFocusedRowIndex(0);
            hdCollection.Set("ID", obj.GetRowKey(0));
            ASPxCallback1.PerformCallback("setinfo");
            GVScrollToVisibleIndexOnClient(obj, obj.GetFocusedRowIndex());
        }

        function last(obj) {
            if (obj.GetFocusedRowIndex() == 0) {
                alert("当前已是第一条");
            }
            else {
                hdCollection.Set("ID", obj.GetRowKey(obj.GetFocusedRowIndex() - 1));
                obj.SetFocusedRowIndex(obj.GetFocusedRowIndex() - 1);
                ASPxCallback1.PerformCallback("setinfo");
            }
            GVScrollToVisibleIndexOnClient(obj, obj.GetFocusedRowIndex());
        }

        function next(obj) {
            if (obj.GetFocusedRowIndex() == obj.GetVisibleRowsOnPage() - 1) {
                alert("当前已是最后一条");
            }
            else {
                hdCollection.Set("ID", obj.GetRowKey(obj.GetFocusedRowIndex() + 1));
                obj.SetFocusedRowIndex(obj.GetFocusedRowIndex() + 1);
                ASPxCallback1.PerformCallback("setinfo");
            }
            GVScrollToVisibleIndexOnClient(obj, obj.GetFocusedRowIndex());
        }

        function final(obj) {
            hdCollection.Set("ID", obj.GetRowKey(obj.GetVisibleRowsOnPage() - 1));
            obj.SetFocusedRowIndex(obj.GetVisibleRowsOnPage() - 1);
            ASPxCallback1.PerformCallback("setinfo");
            GVScrollToVisibleIndexOnClient(obj, obj.GetFocusedRowIndex());
        }

        function rowClick() {
            if (gvYongHuXX.GetFocusedRowIndex() != -1) {
                //alert(gvYongHuXX.GetRowKey(gvYongHuXX.GetFocusedRowIndex()));
                if (gvYongHuXX.GetFocusedRowIndex() != -1) {
                    hdCollection.Set("ID", gvYongHuXX.GetRowKey(gvYongHuXX.GetFocusedRowIndex()));
                    //loadpanel1.Show();
                    ASPxCallback1.PerformCallback("setinfo");
                }
            }
        }

        function ASPxCallback1Complete(rs) {
            var arr = rs.split('|');
            var type = arr[0];
            var state = arr[1];
           // loadpanel1.Hide();
            if (type == "setinfo") {
                txtYongHuH2.SetText(arr[2]);
                txtYongHuM2.SetText(arr[3]);
                txtGuanLiBM.SetText(arr[4]);
                txtGuanLiK.SetText(arr[5]);
                txtYeWuYH.SetText(arr[6]);
                txtYeWuY.SetText(arr[7]);
                txtHeTongH.SetText(arr[8]);
                txtDiZhi.SetText(arr[9]);
            }
        }
        
    </script>
</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
        <div class="tabletitle1" align="center">
            用户信息简讯
        </div>
        <div style="display: none;">
            <dx:ASPxHiddenField ID="hdCollection" ClientInstanceName="hdCollection" runat="server"></dx:ASPxHiddenField>
            <dx:ASPxCallback ID="ASPxCallback1" ClientInstanceName="ASPxCallback1" runat="server" OnCallback="ASPxCallback1_Callback" ClientSideEvents-CallbackComplete="function(s,e){ASPxCallback1Complete(e.result);}"></dx:ASPxCallback>
        </div>
        <asp:UpdatePanel ID="updatePanel1" runat="server">
            <ContentTemplate>
                <div>
                    <div style="border: 1px solid #d0e4fe">
                        <table>
                            <tr>
                                <td>&nbsp;</td>
                                <td style="width:7%;"><span style="font-size: 12px;">管理部门：</span></td>
                                <td>
                                    <asp:Panel runat="server" ID="Panel1">
                                        <dx:ASPxComboBox runat="server" ID="cmbGuanLiBM" Width="60%" AutoPostBack="true" OnSelectedIndexChanged="cmbGuanLiBM_SelectedIndexChanged">
                                            <Items>
                                                <dx:ListEditItem Text="全部" Value="" Selected="true" />
                                            </Items>
                                        </dx:ASPxComboBox>
                                    </asp:Panel>
                                </td>
                                <td style="width:6%;"><span style="font-size: 12px;">管理块：</span></td>
                                <td>
                                    <asp:Panel runat="server" ID="Panel2">
                                        <dx:ASPxComboBox runat="server" ID="cmbGuanLiK" Width="60%">
                                            <Items>
                                                <dx:ListEditItem Text="全部" Value="" Selected="true"  />
                                            </Items>
                                        </dx:ASPxComboBox>
                                    </asp:Panel>
                                </td>
                                <td style="width:6%;"><span style="font-size: 12px;">业务员：</span></td>
                                <td>
                                    <asp:Panel runat="server" ID="Panel3">
                                        <dx:ASPxComboBox runat="server" ID="cmbYeWuY" Width="60%">
                                            
                                        </dx:ASPxComboBox>
                                    </asp:Panel>
                                </td>
                                <td style="width:7%;"><span style="font-size: 12px;">水量年月：</span></td>
                                <td>
                                    <dx:ASPxTextBox runat="server" ID="txtShuiLiangYM"  Width="45%" ClientInstanceName="txtShuiLiangYM">
                                        <ClientSideEvents KeyUp="function(s,e){inputNum(s);}" />
                                    </dx:ASPxTextBox>
                                </td>
                                <td style="width:13%;">
                                    <dx:ASPxCheckBox runat="server" ID="txtYuKaoH" Text="包含预考核账户" ClientVisible="false"></dx:ASPxCheckBox>
                                </td>
                                <td>&nbsp;&nbsp;</td>
                                <td>

                                    <dx:ASPxLoadingPanel runat="server" ID="LoadPanel11" ClientInstanceName="LoadPanel" Text="正在查询"></dx:ASPxLoadingPanel>
                                    <dx:ASPxButton runat="server" ID="btnChaXun" Text="查询" OnClick="btnChaXun_Click">
                                        <ClientSideEvents Click="function(s,e){LoadPanel.Show();}"/>
                                    </dx:ASPxButton>
                                </td>
                            </tr>
                        </table>
                    </div>
                    <div>
                        <fieldset style="border: 1px solid #d0e4fe">
                            <legend>用户信息</legend>
                            <div>
                                <div style="float: left; border: 1px solid #d0e4fe; width: 15%;"  id="condition">
                                    <table  style="height: 270px; width: 100%;">
                                        <tr>
                                            <td>
                                                <dx:ASPxRadioButton runat="server" ID="chkYongHuH" Checked="false" Text="用户号"  ClientInstanceName="chkYongHuH" GroupName="1"></dx:ASPxRadioButton>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <dx:ASPxTextBox runat="server" ID="txtYongHuH"  Width="80%" >
                                                    <ClientSideEvents   GotFocus="function(s,e){chkYongHuH.SetChecked(true);}"/>                                                    
                                                </dx:ASPxTextBox>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <dx:ASPxRadioButton runat="server" ID="chkYongHuM" Text="用户名" GroupName="1" ClientInstanceName="chkYongHuM" ></dx:ASPxRadioButton>                                  
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <dx:ASPxTextBox runat="server" ID="txtYongHuM"  Width="100%">
                                                    <ClientSideEvents   GotFocus="function(s,e){chkYongHuM.SetChecked(true);}"/> 
                                                </dx:ASPxTextBox>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <dx:ASPxRadioButton runat="server" ID="chkYongHuDZ" Text="用户地址" GroupName="1" ClientInstanceName="chkYongHuDZ"></dx:ASPxRadioButton>                      
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <dx:ASPxTextBox runat="server" ID="txtYongHuDZ"  Width="100%">
                                                    <ClientSideEvents   GotFocus="function(s,e){chkYongHuDZ.SetChecked(true);}"/>
                                                </dx:ASPxTextBox>
                                            </td>
                                        </tr>
                                        <tr><td>&nbsp;&nbsp;&nbsp;&nbsp;</td></tr>
                                        <tr>
                                            <td>
                                                <dx:ASPxCheckBox runat="server" ID="chkShiFouQR" Text="银行是否确认" ClientVisible="false"></dx:ASPxCheckBox>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <asp:Panel runat="server" ID="Panel4">
                                                    <dx:ASPxComboBox runat="server" ID="cmbShiFouQR" Width="100%" ClientVisible="false">
                                                        <Items>
                                                            <dx:ListEditItem Text="" Value="" Selected="true" />
                                                            <dx:ListEditItem Text="银行已确认" Value="0"  />
                                                            <dx:ListEditItem Text="银行未确认" Value="1" />
                                                            <dx:ListEditItem Text="农行用户" Value="2" />
                                                        </Items>
                                                    </dx:ASPxComboBox>
                                                </asp:Panel>
                                            </td>
                                        </tr>
                                        <tr style="float: right;">
                                            <td>
                                                <dx:ASPxButton runat="server" ID="btnDaYinYJDZ" Text="打印邮寄地址"></dx:ASPxButton>
                                            </td>
                                        </tr>

                                    </table>
                                </div>
                            </div>
                            <div style="float: right; border: 1px solid #d0e4fe; width: 84%;">
                                <div id="img">
                                    <table>
                                        <tr>
                                            <td style="width:70px;"><div onclick="first(gvYongHuXX);"><img src="../../../Images/first.jpg" /></div></td>
                                            <td style="width:70px;"><div onclick="last(gvYongHuXX);"><img src="../../../Images/last.jpg" /></div></td>
                                            <td style="width:70px;"><div onclick="next(gvYongHuXX);"><img src="../../../Images/next.jpg" /></div></td>
                                            <td style="width:70px;"><div onclick="final(gvYongHuXX);"><img src="../../../Images/final.jpg" /></div></td>
                                            <td style="width: 70px;">&nbsp;</td>
                                            <td>
                                                <dx:ASPxLabel ID="zjl" Text="共0条" runat="server" ForeColor="Blue"></dx:ASPxLabel>
                                            </td>
                                        </tr>
                                    </table>
                                </div>
                                <div>
                                    <dx:ASPxGridView ID="gvYongHuXX" ClientInstanceName="gvYongHuXX" runat="server" AutoGenerateColumns="False" KeyFieldName="ID" 
                                        ClientIDMode="AutoID" Settings-ShowVerticalScrollBar="true" Width="100%"   EnableCallBacks="true">
                                        <Columns>
                                            <dx:GridViewDataTextColumn FieldName="用户号" Caption="用户号" Width="10%">
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataTextColumn FieldName="用户名" Caption="用户名" Width="30%">
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataTextColumn FieldName="用户地址" Caption="用户地址" Width="30%">
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataTextColumn FieldName="邮编" Caption="邮编" Width="10%">
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataTextColumn FieldName="业务员" Caption="业务员" Width="10%">
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataTextColumn FieldName="管理部门" Caption="管理部门" Width="10%">
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataTextColumn FieldName="管理块" Caption="管理块" Width="10%">
                                            </dx:GridViewDataTextColumn>

                                        </Columns>
                                        <Settings VerticalScrollBarMode="Visible"  HorizontalScrollBarMode="Auto" />
                                        <SettingsPager   Mode="EndlessPaging" PageSize="100"  />
                                        <Settings ShowFooter="True" />
                                        <SettingsBehavior AllowFocusedRow="True"  ColumnResizeMode="Control" />
                                        <%--<SettingsBehavior ColumnResizeMode="NextColumn" />
                                        <SettingsBehavior AllowFocusedRow="True"  ColumnResizeMode="Control" />
                                        <Settings GridLines="Vertical" ShowFilterRow="false" />
                                        <Settings ShowHorizontalScrollBar="True" />
                                        <Settings VerticalScrollBarMode="Visible" VerticalScrollableHeight="400" />
                                        <SettingsPager  PageSize="15"  />
                                        <%--<SettingsBehavior ColumnResizeMode="NextColumn" />
                                        <SettingsBehavior AllowFocusedRow="True"  ColumnResizeMode="Control" />
                                        <Settings ShowHorizontalScrollBar="True" />
                                        --%>
                                        <ClientSideEvents FocusedRowChanged="function(s,e){rowClick();}" />
                                        <SettingsBehavior ProcessFocusedRowChangedOnServer="false" />
                                        <ClientSideEvents Init="function(s,e){AdjustSize(250,gvYongHuXX);}"  />
                                    </dx:ASPxGridView>
                                </div>
                                <br />
                                <hr />
                                <div>
                                    <table style="text-align: right;  width: 100%;">
                                        <tr>
                                            <td style="width:10%;"><span style="font-size: 12px;">用户号：</span></td>
                                            <td>
                                                <dx:ASPxTextBox runat="server" ID="txtYongHuH2"  ClientEnabled="false" Width="80%"  ClientInstanceName="txtYongHuH2"></dx:ASPxTextBox>
                                            </td>
                                            <td style="width:10%;"><span style="font-size: 12px;">用户名：</span></td>
                                            <td colspan="5">
                                                <dx:ASPxTextBox runat="server" ID="txtYongHuM2"  ClientEnabled="false"  Width="100%" ClientInstanceName="txtYongHuM2"></dx:ASPxTextBox>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td><span style="font-size: 12px;">管理部门：</span></td>
                                            <td>
                                                <dx:ASPxTextBox runat="server" ID="txtGuanLiBM" ClientEnabled="false"  Width="80%" ClientInstanceName="txtGuanLiBM"></dx:ASPxTextBox>
                                            </td>
                                            <td><span style="font-size: 12px;">管理块：</span></td>
                                            <td>
                                                <dx:ASPxTextBox runat="server" ID="txtGuanLiK" ClientEnabled="false"  Width="80%" ClientInstanceName="txtGuanLiK"></dx:ASPxTextBox>
                                            </td>
                                            <td style="width:10%;"><span style="font-size: 12px;">业务员号：</span></td>
                                            <td>
                                                <dx:ASPxTextBox runat="server" ID="txtYeWuYH" ClientEnabled="false" Width="80%" ClientInstanceName="txtYeWuYH"></dx:ASPxTextBox>
                                            </td>
                                            <td style="width:10%;"><span style="font-size: 12px;">业务员：</span></td>
                                            <td>
                                                <dx:ASPxTextBox runat="server" ID="txtYeWuY" ClientEnabled="false"  Width="100%" ClientInstanceName="txtYeWuY"></dx:ASPxTextBox>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td><span style="font-size: 12px;">合同号：</span></td>
                                            <td colspan="7">
                                                <dx:ASPxTextBox runat="server" ID="txtHeTongH" ClientEnabled="false"  Width="100%" ClientInstanceName="txtHeTongH"></dx:ASPxTextBox>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td><span style="font-size: 12px;">地址：</span></td>
                                            <td colspan="7">
                                                <dx:ASPxTextBox runat="server" ID="txtDiZhi" ClientEnabled="false"  Width="100%" ClientInstanceName="txtDiZhi"></dx:ASPxTextBox>
                                            </td>
                                        </tr>
                                    </table>
                                </div>
                            </div>
                        </fieldset>
                    </div>
                </div>
            </ContentTemplate>

        </asp:UpdatePanel>
    </form>
</body>
</html>
